//package com.smartstate.ems.config;
//
//import lombok.RequiredArgsConstructor;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.redis.connection.RedisConnectionFactory;
//import org.springframework.security.oauth2.provider.token.TokenStore;
//import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;
//
///**
// * @ClassName: CustomTokenStoreAutoConfiguration
// * @Description:  redis token store 自动配置
// * @author: ruyi
// * @date: 2022/2/28 19:25
// */
//@RequiredArgsConstructor
//@Configuration(proxyBeanMethods = false)
//public class CustomTokenStoreAutoConfiguration {
//
//    private final KeyStrResolver resolver;
//
//    private final RedisConnectionFactory connectionFactory;
//
//
//    @Bean
//    public TokenStore tokenStore() {
//        RedisTokenStore tokenStore = new RedisTokenStore(connectionFactory);
//        tokenStore.setPrefix(SecurityConstants.PIGX_PREFIX,SecurityConstants.OAUTH_PREFIX);
//        tokenStore.setAuthenticationKeyGenerator(new CustomAuthenticationKeyGenerator ());
//        return tokenStore;
//    }
//
//
//
//}
